//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections.Generic;
using System.Text;
using OpenLS.Chart.UI;
using OpenLS.Chart;

namespace OpenLS.Spreadsheet.UI
{
    public class ChartTemplates
    {
        public static List<ColumnChartTemplate> ColumnTemplates{get{return new List<ColumnChartTemplate>(columnTemplates);}}
        static IEnumerable<ColumnChartTemplate> columnTemplates
        {
            get
            {
                foreach (BarGrouping grouping in GetBarGroupingsNoStandard())
                    yield return new ColumnChartTemplate
                {
                    Grouping = grouping
                }
                ;
                foreach (ColumnChartTemplate t in column3DTemplates)
                    yield return t;
            }
        }
        public static List<BarChartTemplate> BarTemplates{get{return new List<BarChartTemplate>(barTemplates);}}
        static IEnumerable<BarChartTemplate> barTemplates
        {
            get
            {
                foreach (BarGrouping grouping in GetBarGroupingsNoStandard())
                        yield return new BarChartTemplate
                        {
                            Grouping = grouping
                        }
                    ;
                foreach (Bar3DChartTemplate t in bar3DTemplates)
                    yield return t;
            }
        }
        public static List<ChartTemplate>LineTemplates{get{return new List<ChartTemplate>(lineTemplates);}}
        static IEnumerable<ChartTemplate> lineTemplates
        {
            get
            {
                foreach (Grouping grouping in GetGroupings())
                {
                    yield return new LineChartTemplate { Grouping = grouping };
                }
                foreach (Grouping grouping in GetGroupings())
                {
                    yield return new LineChartTemplate { Grouping = grouping, Marker=true };
                }
                yield return new Line3DChartTemplate();
            }
        }
        public static List<ChartTemplate> PieTemplates { get { return new List<ChartTemplate>(pieTemplates); } }
        static IEnumerable<ChartTemplate> pieTemplates
        {
            get
            {
                yield return new PieChartTemplate();
                yield return new PieChartTemplate
                {IsExploded = true
                }
                ;
                yield return new Pie3DChartTemplate();
                yield return new Pie3DChartTemplate
                {IsExploded = true
                }
                ;
            }
        }
        public static List<ChartTemplate> ScatterTemplates { get { return new List<ChartTemplate>(scatterTemplates); } }
        static IEnumerable<ChartTemplate> scatterTemplates
        {
            get
            {
                yield return new ScatterChartTemplate
                {
                    HasMarkers = true, NoLine = true
                }
                ;
                yield return new ScatterChartTemplate
                                 {
                                     HasMarkers = true,
                                     IsSmooth = true
                }
                ;
                yield return new ScatterChartTemplate
                                 {
                                     HasMarkers = false,
                                     IsSmooth = true
                }
                ;
                yield return new ScatterChartTemplate
                                 {
                                     HasMarkers = true,
                                     IsSmooth = false
                }
                ;
                yield return new ScatterChartTemplate
                {
                    HasMarkers = false,
                    IsSmooth = false
                }
                ;
            }
        }
        public static List<ChartTemplate> AreaTemplates { get { return new List<ChartTemplate>(areaTemplates); } }
        static IEnumerable<ChartTemplate> areaTemplates
        {
            get
            {
                foreach (Grouping grouping in GetGroupings())
                {
                    yield return new AreaChartTemplate { Grouping = grouping };
                }
                foreach (Grouping grouping in GetGroupings())
                {
                    yield return new Area3DChartTemplate { Grouping = grouping };
                }
            }
        }
        static IEnumerable<ColumnChartTemplate> column3DTemplates
        {
            get
            {
                foreach (ChartShape shape in GetShapes())
                    foreach (BarGrouping gr in GetBarGroupings())
                        yield return new Column3DChartTemplate { Grouping = gr, Shape = shape };
            }
        }
        static IEnumerable<Bar3DChartTemplate> bar3DTemplates
        {
            get
            {
                foreach (ChartShape shape in GetShapes())
                    foreach (BarGrouping gr in GetBarGroupingsNoStandard())
                        yield return new Bar3DChartTemplate { Grouping = gr, Shape = shape };
            }
        }
        static IEnumerable<ChartShape> GetShapes()
        {
            yield return ChartShape.Box;
            yield return ChartShape.Cylinder;
            yield return ChartShape.Cone;
            yield return ChartShape.Pyramid;
        }
        static IEnumerable<BarGrouping> GetBarGroupings()
        {
            yield return BarGrouping.Clustered;
            yield return BarGrouping.Stacked;
            yield return BarGrouping.PercentStacked;
            yield return BarGrouping.Standard;
        }
        static IEnumerable<BarGrouping> GetBarGroupingsNoStandard()
        {
            yield return BarGrouping.Clustered;
            yield return BarGrouping.Stacked;
            yield return BarGrouping.PercentStacked;
        }
        static IEnumerable<Grouping> GetGroupings()
        {
            yield return Grouping.Standard;
            yield return Grouping.Stacked;
            yield return Grouping.PercentStacked;
        }
    }
}
